package BasicTypes;

public class Table {
	
	
	public static Position getPosition(int x){
		int j = (int) Math.sqrt(x);
		int r = x - j*j;
		for(int i = 0; i < j; i++){
			if(r-- == 0){
				return new Position(i,j);
			}
			if(r-- == 0){
				return new Position(j,i);
			}
		}
		return new Position(j,j);
	} 
}
